package rudy.elevator.bean;

public class LiftBean implements java.io.Serializable {
    public int liftid;
    public LiftFlower  flowers [];
    private boolean isrun =false;
    private boolean isopen = false;
    private boolean isup = false;
    private boolean isdown = false;
    private boolean init = false;
    private boolean wait = true;
    private int weight = 1000;
    private int currentlyflower =0;
    private int x_point1;
    private int x_point2;
    private int y_point1;
    private int y_point2;
    private String name;

    private int x;
    private int y;
    private int dx;
    private int dy;

    private int flowerhight;

    public int xx =0;
    public int yy =0;
    public LiftBean() {
    }

    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isIsopen() {
        return isopen;
    }

    public boolean isIsrun() {
        return isrun;
    }

    public int getWeight() {
        return weight;
    }

    public int getCurrentlyflower() {
        return currentlyflower;
    }

    public int getDx() {
        int xx =  (this.x_point2 -this.x_point1);
         return   (xx*2)/4;
     //   return dx;
    }

    public int getDy() {
        int yy = (y_point1 - y_point2);
        return (yy*3)/4;

        //return dy;
    }

    public int getX() {

         int xx =  (x_point2 -x_point1);
         return   x_point1 + (xx * 1)/4;
      //  return x;
    }

    public int getX_point1() {
        return x_point1;
    }

    public int getX_point2() {
        return x_point2;
    }

    public int getY() {

        int yy = (y_point1 - y_point2);
        y = y_point2 + (yy *1)/4;
     //   System.out.println(y);
        return y;
       // return y;
    }

    public int getrealeaseY()
    {
        if( y == 0)
        {
            getY();
        }
        return y;

    }

    public int getY_point1() {
        return y_point1;
    }

    public int getY_point2() {
        return y_point2;
    }

    public boolean isInit() {
        return init;
    }

    public int getYy() {
        return yy;
    }

    public int getXx() {
        return xx;
    }

    public int getFlowerhight() {
        return flowerhight;
    }

    public LiftFlower[] getFlowers() {
        return flowers;
    }

    public boolean isIsdown() {
        return isdown;
    }

    public boolean isIsup() {
        return isup;
    }

    public boolean isWait() {
        return wait;
    }

    public int getLiftid() {
        return liftid;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public void setIsrun(boolean isrun) {
        this.isrun = isrun;
    }

    public void setCurrentlyflower(int currentlyflower) {
        this.currentlyflower = currentlyflower;
    }

    public void setIsopen(boolean isopen) {
        this.isopen = isopen;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setDy(int dy) {
        this.dy = dy;
    }

    public void setDx(int dx) {
        this.dx = dx;
    }

    public void setY_point2(int y_point2) {
        this.y_point2 = y_point2;
    }

    public void setX_point2(int x_point2) {
        this.x_point2 = x_point2;
    }

    public void setX_point1(int x_point1) {
        this.x_point1 = x_point1;
    }

    public void setY_point1(int y_point1) {
        this.y_point1 = y_point1;


      //  System.out.println("   " + getX() + "   " +y_point1);
    }

    public void setInit(boolean init) {
        this.init = init;
    }

    public void setXx(int xx) {
        this.xx = xx;
    }

    public void setYy(int yy) {
        this.yy = yy;
    }

    public void setFlowerhight(int flowerhight) {
        this.flowerhight = flowerhight;
    }

    public void setFlowers(LiftFlower[] flowers) {
        this.flowers = flowers;
    }

    public void setIsup(boolean isup) {
        this.isup = isup;
        if(isup)
        {
            this.isdown = !isup;
        }
    }

    public void setIsdown(boolean isdown) {
        this.isdown = isdown;
        if(isdown)
        {
            this.isup = !isdown;
        }
    }

    public void setWait(boolean wait) {
        this.wait = wait;
    }

    public void setLiftid(int liftid) {
        this.liftid = liftid;
    }

    public void setUp()
    {
        this.y_point1--;
        this.y_point2--;
    }
    public void setDown()
    {
        this.y_point1++;
        this.y_point2++;
    }
}
